package com.ildepinc.persistence.abstracts;

import com.ildepinc.persistence.interfaces.JdbcDriverBehaviour;

public abstract class JdbcDriverBase implements JdbcDriverBehaviour {
  private String driverClass;
  private String databaseEngine;
  private String url;
  private String host;
  private Integer port;
  private String database;
  private String user;
  private String password;
  private Boolean embedded;
  private Boolean databaseCreateIfNone;

  @Override
  public String getDatabase() {
    return this.database;
  }

  @Override
  public String getDatabaseEngine() {
    return this.databaseEngine;
  }

  @Override
  public String getDriverClass() {
    return this.driverClass;
  }

  @Override
  public String getHost() {
    return this.host;
  }

  @Override
  public String getPassword() {
    return this.password;
  }

  @Override
  public Integer getPort() {
    return this.port;
  }

  @Override
  public String getUrl() {
    return this.url;
  }

  @Override
  public String getUser() {
    return this.user;
  }

  public Boolean isDatabaseCreateIfNone() {
    return this.databaseCreateIfNone;
  }

  @Override
  public Boolean isEmbedded() {
    return this.embedded;
  }

  @Override
  public void setDatabase(String database) {
    this.database = database;
  }

  public void setDatabaseCreateIfNone(Boolean databaseCreateIfNone) {
    this.databaseCreateIfNone = databaseCreateIfNone;
  }

  @Override
  public void setDatabaseEngine(String databaseEngine) {
    this.databaseEngine = databaseEngine;
  }

  @Override
  public void setDriverClass(String driverClass) {
    this.driverClass = driverClass;
  }

  @Override
  public void setEmbedded(Boolean embedded) {
    this.embedded = embedded;
  }

  @Override
  public void setHost(String host) {
    this.host = host;
  }

  @Override
  public void setPassword(String password) {
    this.password = password;
  }

  @Override
  public void setPort(Integer port) {
    this.port = port;
  }

  @Override
  public void setUrl(String url) {
    this.url = url;
  }

  @Override
  public void setUser(String user) {
    this.user = user;
  }

  protected void clear() {
    this.driverClass = null;
    this.databaseEngine = null;
    this.url = null;
    this.host = null;
    this.port = null;
    this.database = null;
    this.user = null;
    this.password = null;
    this.embedded = null;
    this.databaseCreateIfNone = null;
  }
}
